package com.springboot.logback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * neu
 * 2019/7/25 16:03
 *
 * @Version : 1.0
 * @Description :
 */

@SpringBootApplication
public class ApplicationTest {

    public static void main(String[] args) {
        SpringApplication.run(ApplicationTest.class,args);
        log();
    }

    //定义一个全局的记录器，通过LoggerFactory获取
    private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);

    public static void log() {
        System.out.println("222222222222222222222222");
        logger.info("logback 成功了");
        logger.error("logback 成功了");
    }
}
